﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SuperKTV.Admin
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string username = this.txt_userName.Text;
            string password = this.txt_password.Text;
            if (username=="" || password=="")
            {
                MessageBox.Show("用户名和密码不能为空");
                return;
            }
            if (username =="admin" && password=="admin")
            {
                MessageBox.Show("登录成功！");
                // 登录成功，显示MDI窗体
                MainForm mainForm = new MainForm();
                mainForm.Show();
                // 隐藏登录窗体
                this.Hide();
            }
            else
            {
                MessageBox.Show("登录失败！");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //this.Close();
            Application.Exit();
        }

        private void llbl_register_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            new RegisterForm().Show();
        }
    }
}
